-- GENERATED SPELL FOR [Kaylaan the Lost] --


function spell0_20794(pUnit, Event) --@Avenger\'s Shield,n/a--
pUnit:FullCastSpellOnTarget(37554,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20794', 7000, 1)
end

function spell1_20794(pUnit, Event) --@Burning Light,n/a--
pUnit:FullCastSpellOnTarget(37552,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20794', 623, 1)
end

function spell2_20794(pUnit, Event) --@Cancel Power of the Legion,n/a--
pUnit:FullCastSpellOnTarget(35597,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20794', 674, 1)
end

function spell3_20794(pUnit, Event) --@Consecration,Self--
pUnit:FullCastSpellOnTarget(37553,pUnit)
pUnit:RegisterEvent('Sorts_20794', 5000, 1)
end

function spell4_20794(pUnit, Event) --@Divine Shield,Self--
pUnit:FullCastSpellOnTarget(13874,pUnit)
pUnit:RegisterEvent('Sorts_20794', 8337, 1)
end

function spell5_20794(pUnit, Event) --@Heal,Heal--
pUnit:FullCastSpellOnTarget(37569,pUnit)
pUnit:RegisterEvent('Sorts_20794', 3500, 1)
end

function spell6_20794(pUnit, Event) --@Holy Slam,n/a--
pUnit:FullCastSpellOnTarget(37572,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20794', 643, 1)
end

function spell7_20794(pUnit, Event) --@Kaylan\'s Wrath,Self--
pUnit:FullCastSpellOnTarget(35614,pUnit)
pUnit:RegisterEvent('Sorts_20794', 607, 1)
end

function spell8_20794(pUnit, Event) --@Resurrection,n/a--
pUnit:FullCastSpellOnTarget(35599,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_20794', 4000, 1)
end

function Sorts_20794(pUnit, Event)
local choix_sorts_20794 = math.random(0, 8)
if choix_sorts_20794 == 0 then
pUnit:RegisterEvent('spell0_20794', 1, 1)
end
if choix_sorts_20794 == 1 then
pUnit:RegisterEvent('spell1_20794', 1, 1)
end
if choix_sorts_20794 == 2 then
pUnit:RegisterEvent('spell2_20794', 1, 1)
end
if choix_sorts_20794 == 3 then
pUnit:RegisterEvent('spell3_20794', 1, 1)
end
if choix_sorts_20794 == 4 then
pUnit:RegisterEvent('spell4_20794', 1, 1)
end
if choix_sorts_20794 == 5 then
pUnit:RegisterEvent('spell5_20794', 1, 1)
end
if choix_sorts_20794 == 6 then
pUnit:RegisterEvent('spell6_20794', 1, 1)
end
if choix_sorts_20794 == 7 then
pUnit:RegisterEvent('spell7_20794', 1, 1)
end
if choix_sorts_20794 == 8 then
pUnit:RegisterEvent('spell8_20794', 1, 1)
end
end

function mob20794_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_20794', math.random(1500, 3000), 1)
end

function mob20794_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20794_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob20794_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(20794, 1, 'mob20794_Action')
RegisterUnitEvent(20794, 2, 'mob20794_Leave')
RegisterUnitEvent(20794, 3, 'mob20794_Kill')
RegisterUnitEvent(20794, 4, 'mob20794_Die')
